package com.gzlz.budejie.activity;

import javax.crypto.spec.IvParameterSpec;

import com.gzlz.budejie.R;
import com.gzlz.budejie.R.layout;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

/*
 * 设置页面
 * */
public class SettingActivity extends Activity implements OnClickListener {

	private TextView tv_setting_back;
	private ImageView iv_setting_top;
	private ImageView iv_setting_bottom;
	private ImageView iv_setting_save;
	private ImageView iv_setting_collect;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_setting);

		tv_setting_back = (TextView) findViewById(R.id.tv_setting_back);
		iv_setting_top = (ImageView) findViewById(R.id.iv_setting_top);
		iv_setting_bottom = (ImageView) findViewById(R.id.iv_setting_bottom);
		iv_setting_save = (ImageView) findViewById(R.id.iv_setting_save);
		iv_setting_collect = (ImageView) findViewById(R.id.iv_setting_collect);

		// 设置点击回退事件
		tv_setting_back.setOnClickListener(this);
		iv_setting_top.setOnClickListener(this);
		iv_setting_bottom.setOnClickListener(this);
		iv_setting_save.setOnClickListener(this);
		iv_setting_collect.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.tv_setting_back:
			finish();
			break;
		case R.id.iv_setting_top:
			if (iv_setting_top.isSelected()) {
				iv_setting_top.setSelected(false);
			} else {
				iv_setting_top.setSelected(true);
			}
			break;
		case R.id.iv_setting_bottom:
			if (iv_setting_bottom.isSelected()) {
				iv_setting_bottom.setSelected(false);
			} else {
				iv_setting_bottom.setSelected(true);
			}
			break;
		case R.id.iv_setting_save:
			if (iv_setting_save.isSelected()) {
				iv_setting_save.setSelected(false);
			} else {
				iv_setting_save.setSelected(true);
			}
			break;
		case R.id.iv_setting_collect:
			if (iv_setting_collect.isSelected()) {
				iv_setting_collect.setSelected(false);
			} else {
				iv_setting_collect.setSelected(true);
			}
			break;

		default:
			break;
		}
	}
}
